﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DTO;
using DAO;
namespace BUS
{
    public class HoaDonBUS
    {
        // ------- LOI -----------------
        public List<HoaDonDTO> LayDanhSachHoaDonL(int loaiHD)
        {
            HoaDonDAO hdDAO = new HoaDonDAO();
            return hdDAO.LayDanhSachHoaDonL(loaiHD);
        }
        public string ThemHoaDonBanL(HoaDonDTO hdDTO)
        {
            HoaDonDAO hdDAO = new HoaDonDAO();
            return hdDAO.ThemHoaDonL(hdDTO);
        }
        public int LayMaHoaDonL()
        {
            HoaDonDAO hdDAO = new HoaDonDAO();
            return hdDAO.LayMaHoaDonL();
        }
        public string XoaHoaDonL(int maHD)
        {
            HoaDonDAO hdDAO = new HoaDonDAO();
            return hdDAO.XoaHoaDonL(maHD);
        }
        public HoaDonDTO ThongTinHoaDonTheoMaL(int maHD)
        {
            HoaDonDAO hdDAO = new HoaDonDAO();
            return hdDAO.ThongTinHoaDonTheoMaL(maHD);
        }
        public long LayThoiGianGiaoL(int maHD)
        {
            HoaDonDAO hdDAO = new HoaDonDAO();
            return hdDAO.LayThoiGianGiaoL(maHD);
        }
        public string CapNhatTinhTrang(int maHD, int tt)
        {
            HoaDonDAO hdDAO = new HoaDonDAO();
            return hdDAO.CapNhatTinhTrangL(maHD, tt);
        }
        //END ------------ LOI --------------------

        //KHANG
        public List<HoaDonDTO> LayDanhSachHoaDon()
        {
            HoaDonDAO dao = new HoaDonDAO();
            return dao.LayDanhSachHoaDon();
        }
        public List<HoaDonDTO> Tra_cuu_hoa_don(string mahoadon, string tenkhachhang, DateTime tungay, DateTime denngay)
        {
            HoaDonDAO tracuu = new HoaDonDAO();
            return tracuu.Tra_cuu_hoa_don(mahoadon, tenkhachhang, tungay, denngay);
        }
        //END KHANG
    }
}
